<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>两栏布局</title>
    <style>
        /* 第一种  利用浮动 */
        /* .outer {
            height: 100px;
        }

        .left {
            float: left;
            width: 200px;
            background: tomato;
        }

        .right {
            margin-left: 200px;
            width: auto;
            background: gold;
        } */
        /* 第二种利用浮动和BFC */
        /*         .outer{
            height: 100px;
        }
        .left{
            float: left;
            width: 100px;
            height: 200px;
            background-color: red;
        }
        .right{
            overflow: hidden;
            height: 300px;
            background-color:blue;
        } */
        /* 第三种 利用定位   左边定位  右边定位 */
   /*      .outer {
            position: relative;
            height: 100px;
        }

        .left {
            position: absolute;
            width: 200px;
            height: 200px;
            background-color: red;
        }

        .right {
            margin-left: 200px;
            background-color: pink;
        } */
      /*   .outer {
            position: relative;
            height: 100px;
        }

        .left {
            width: 200px;
            height: 200px;
            background-color: red;
        }

        .right {
            position: absolute;
            left: 200px;
            top: 0;
            right: 0;
            bottom: 0;
            background-color: pink;
        } */

        /* 利用flex布局 */
        .outer{
            display: flex;
        }
        .left{
            flex-shrink: 0;
            width: 200px;
            height: 100px;
            background-color: red;
        }
        .right{
            flex-grow: 1;
            height: 100px;
            background-color: orange;
        }
    </style>
</head>

<body>
    <!-- 左边宽度固定  右边宽度自适应 -->
    <div class="outer">
        <div class="left">
            left-area
        </div>
        <div class="right">
            right-area
        </div>
    </div>

</body>

</html>